package com.cxf.windex.rest;

import com.cxf.windex.base.constant.UserConstant;
import com.cxf.windex.base.msg.ObjectRestResponse;
import com.cxf.windex.base.msg.TableResultResponse;
import com.cxf.windex.base.rest.BaseRestController;
import com.cxf.windex.biz.PositionTownBiz;
import com.cxf.windex.entity.BResouces;
import com.cxf.windex.entity.PositionTown;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 乡镇管理层
 *
 * @author chenxf
 * @version 1.0
 * @date 2018-12-05 11:17
 **/
@Slf4j
@Api(tags = {"通用 - 乡镇查询接口"})
@Controller
@RequestMapping("/user/town")
public class PositionTownController extends BaseRestController<PositionTownBiz, PositionTown> {
    @ApiOperation(value = "根据区县ID查询乡镇列表", notes = "根据区县ID查询乡镇列表")
    @ApiImplicitParams({
        @ApiImplicitParam(name = "countyId", value = "区县ID",   paramType = "path", dataType = "String")
    })
    @RequestMapping(value = "/list/{countyId}", method = RequestMethod.GET)
    @ResponseBody
    public ObjectRestResponse list(@PathVariable String countyId) {
        List<PositionTown> items = baseBiz.list(countyId);
        return ObjectRestResponse.success("查询成功").result(items);
    }
}
